<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<script type="text/javascript" src="<c:url value="/js/jquery.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/tabs.js"/>"></script>

<html>
<head>
    <title>
        PIM
    </title>
    <link rel="stylesheet" type="text/css" href="<c:url value="/css/style.css"/>">
</head>
<body background="<c:url value="/img/bg.png"/>">

<table align="center" border="0" cellspacing="0">
    <tr>
        <td>
            <%@include file="/WEB-INF/inc/header.jsp" %>
        </td>
    </tr>

    <tr bgcolor="#ffffff" height="800" align="center">
        <td>

            <ul class="tabs tabs1">
                <li class="t1   <c:if test="${current=='t1'}" > tab-current </c:if> ">
                    <a> <spring:message code="tab.personal"/></a></li>
                <li class="t2  <c:if test="${current=='t2'}" > tab-current </c:if> "><a> <spring:message
                        code="tab.changepass"/></a></li>
            </ul>


            <div class="t1">
                <form:form method="Post" action="details" commandName="person" enctype="multipart/form-data">


                    <br>
                    <br>
                    <table>

                        <tr>

                            <td><spring:message code="field.avatar"/></td>
                        </tr>
                        <tr>
                            <td>
                                <img height="150" src="<c:url value="/userimg/"/><c:out value="${person.imgurl}"/>"
                                     alt="">
                            </td>
                            <td><input name="avatar" type="file"/></td>
                        </tr>
                        <tr>

                            <td><form:errors class="error"
                                             path="imgurl"/></td>
                        </tr>

                        <tr>

                            <td><spring:message code="field.fname"/><form:errors class="error"
                                                                                 path="fname"/></td>
                        </tr>
                        <tr>
                            <td><form:input path="fname"/></td>
                        </tr>

                        <tr>

                            <td><spring:message code="field.sname"/><form:errors class="error"
                                                                                 path="sname"/></td>
                        </tr>
                        <tr>
                            <td><form:input path="sname"/></td>
                        </tr>

                        <tr>

                            <td><spring:message code="field.tname"/><form:errors class="error"
                                                                                 path="tname"/></td>
                        </tr>
                        <tr>
                            <td><form:input path="tname"/>
                                <form:hidden path="id"/>
                                <form:hidden path="imgurl"/>

                            </td>
                        </tr>


                        <tr>

                            <td><spring:message code="field.group"/></td>
                        </tr>
                        <tr>
                            <td>
                                <form:select path="group.id">
                                    <form:options items="${groupList}" itemValue="Id" itemLabel="name"/>
                                </form:select>
                            </td>
                        </tr>


                        <tr>

                            <td colspan="2" align="center"><input class="button" type="submit"
                                                                  value="  <spring:message code="button.change"/>"/>
                            </td>

                        </tr>


                    </table>

                </form:form>
            </div>


            <div class="t2">

                <form:form method="Post" action="changepass" commandName="person" enctype="multipart/form-data">

                    <br>
                    <br>
                    <table>


                        <tr>

                            <td><spring:message code="field.password"/><form:errors class="error"
                                                                                    path="password"/></td>
                        </tr>

                        <tr>
                            <td><form:password path="password"/></td>
                        </tr>

                        <tr>

                            <td><spring:message code="field.confirmpassword"/></td>
                        </tr>

                        <tr>
                            <td><input type="password" name="confirmpassword" id="confirmpassword"/></td>

                        </tr>

                        <tr>

                            <td colspan="2" align="center"><input class="button" type="submit"
                                                                  value="  <spring:message code="button.change"/>"/>
                            </td>

                        </tr>


                    </table>


                </form:form>


            </div>

        </td>
    </tr>

    <tr>
        <td>
            <%@include file="/WEB-INF/inc/footer.jsp" %>
        </td>
    </tr>

</table>

</body>


</html>